List examples in binaries built
authorAlex Crichton <alex@alexcrichton.com>
Sat, 21 Mar 2015 02:30:47 +0000 (19:30 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Sat, 21 Mar 2015 02:30:47 +0000 (19:30 -0700)
This is required for `cargo run` to work

src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/fingerprint.rs

index 36088778786edb6ab7ed558279ea71ffee19bc5b..22d9dc01c4c77f36608c84fe056e01460ba8ae69 100644 (file)
@@ -376,8 +376,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> {
             ret.push((pkg, t, self.lib_profile(pkg.package_id())));
         }
 
-        // If this is a test profile, then we need to ensure that all binaries
-        // are built.
+        // Integration tests/benchmarks require binaries to be built
         if profile.test && (target.is_test() || target.is_bench()) {
             ret.extend(pkg.targets().iter().filter(|t| t.is_bin())
                           .map(|t| (pkg, t, self.lib_profile(pkg.package_id()))));
index 213a81c0158310daa6c359a7dccdd9279da23867..a88ad00ae4a1a70ae83db84adb2de06bcb6524d6 100644 (file)
@@ -64,7 +64,7 @@ pub fn prepare_target<'a, 'b>(cx: &mut Context<'a, 'b>,
 
             if profile.test {
                 cx.compilation.tests.push((target.name().to_string(), dst));
-            } else if target.is_bin() {
+            } else if target.is_bin() || target.is_example() {
                 cx.compilation.binaries.push(dst);
             } else if target.is_lib() {
                 let pkgid = pkg.package_id().clone();